import request from '@/utils/request'

export function permissionList(data) {
  return request({
    url: '/backend/permission/list',
    method: 'get',
    params: data
  })
}

export function allPermissions() {
  return request({
    url: '/backend/permission/all',
    method: 'get'
  })
}

export function rolePermissions(data) {
  return request({
    url: '/backend/permission/role-permissions',
    method: 'get',
    params: data
  })
}

export function createPermission(data) {
  return request({
    url: '/backend/permission/create',
    method: 'post',
    data
  })
}

export function updatePermission(data) {
  return request({
    url: '/backend/permission/update',
    method: 'post',
    data
  })
}

export function deletePermission(data) {
  return request({
    url: '/backend/permission/delete/' + data.id,
    method: 'get'
  })
}
